package operation;
import  book.booklist;
import  book.book;
import java.util.Scanner;

public class find implements ioperation {
    public void work(booklist booklist){
        System.out.println("find");
        System.out.println("请输入查找书的名字 ");
        Scanner scanner= new Scanner(System.in);
        String name = scanner.nextLine();
        int currentsize=booklist.getUsedsize();

        for(int i=0;i<currentsize;i++){
            book book=booklist.gettops(i);
            if(book.getName().equals(name)){
                System.out.println("ok");
               // System.out.println(booklist.gettops(i));
                System.out.println(book);
                return;
            }
        }
        System.out.println("nofind ");
    }
}
